package com.code.day10.ObjectStream;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        read();
    }
    public static void read() throws Exception{
        ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream("1.txt"));
        Object object = objectInputStream.readObject();
        Person person = (Person)object;
        System.out.println(person);
        objectInputStream.close();
    }
}
